<template>
	<view class="content">

		<view class="fwb" v-if="list.content">
			<u-parse :content="list.content" :imageProp='imageProp' @preview="preview" @navigate="navigate"
				className="html_content" />
		</view>
		<view class="jqqd" v-if="!list.content && yes == 1">
			<view style="height: 280rpx;"></view>
			<image class="jqqdImg" src="@/static/activity/healthHome/jqqd1.png" alt="" />
			</image>
			<image class="di" src="@/static/activity/healthHome/dalou.png" alt="" />
			</image>
		</view>

	</view>
</template>

<script>
	import uParse from '@/components/gaoyia-parse/parse.vue'
	export default {
		components: {
			uParse
		},
		data() {
			return {
				id: null,
				// user: uni.getStorageSync('user'),
				list: [],
				imageProp: {
					mode: 'widthFix',
					padding: 0,
					lazyLoad: false,
					window: '100%'
				},
				yes: 0,
			}
		},
		onLoad(opt) {
			uni.showLoading({
				title: '加载中...'
			});
			this.id = opt.id
			this.data_list(this.id);
		},
		methods: {
			data_list(id) {
				var self = this
				self.$boya.Request({
					url: '/activity/article',
					data: {
						type: 22,
					}
				}, function(res) {
					let data = res.data.data
					console.log('data: ', data);
					for (var i = 0; i < data.length; i++) {
						let children = data[i].children
						for (var j = 0; j < children.length; j++) {
							if (children[j].id == id) {
								self.list = children[j].init_index[0]
							}
						}
					}
					uni.hideLoading();
					self.yes = 1
					console.log('list: ', self.list);
				}, false)
			},
			preview(src, e) {
				// do something
			},
			navigate(href, e) {
				// do something
			}
		}
	}
</script>

<style>
	@import url("/components/gaoyia-parse/parse.css");

	.content {
		width: 100vw;
		min-height: 100vh;
		background-color: #EFF0F5;
	}

	.jqqd {
		width: 100%;
		height: 100vh;
		margin: 0 auto;
		/* margin-top: -30rpx; */
		background: linear-gradient(to bottom, #fff, #435B77);
		/* background-color: #052F55; */
		/* background: url('../../../../static/activity/healthHome/jqqdbj3.png') 100% 100% / 100% 100%; */
	}

	.jqqdImg {
		width: 430rpx;
		height: 720rpx;
		margin-left: 170rpx;
	}

	.di {
		width: 100vw;
		height: 300rpx;
		position: absolute;
		left: 0;
		bottom: 0;
		width: 100vw;
	}
</style>